package com.joysuch.wwyt.patrol.enums;

import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;

/**
 *
 * 智能巡检-上报方式
 *
 * @author heqifeng
 * @since 2022-02-28
 */
public enum RequestBy {
    WEB("W", "web"),
    APP("A", "app");

    private String value;

    private String desc;

    RequestBy(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public final String getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    private static final Map<String, RequestBy> lookup = new HashMap<>();

    static {
        for (RequestBy e : EnumSet.allOf(RequestBy.class)) {
            lookup.put(e.value, e);
        }
    }

    public static RequestBy find(String  value) {
        return lookup.get(value);
    }
}
